package com.future.direction.ui.activity;

import android.support.design.widget.TabLayout;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.future.direction.R;
import com.future.direction.common.util.TabLayoutUtil;
import com.future.direction.common.util.UIUtil;
import com.future.direction.di.component.AppComponent;
import com.future.direction.ui.adapter.TeamAdapter;
import com.future.direction.ui.widget.MyTitleBar;

import butterknife.BindView;

/**
 * Created by zhp on 2019-11-08
 */
public class TeamActivity extends BaseActivity implements View.OnClickListener {

    @BindView(R.id.titleBar)
    MyTitleBar titleBar;
    @BindView(R.id.tablayout)
    TabLayout tablayout;
    @BindView(R.id.recycle_team)
    RecyclerView recycleTeam;
    @BindView(R.id.swipeRefreshLayout_team)
    SwipeRefreshLayout swipeRefreshLayoutTeam;

    private TeamAdapter teamAdapter;

    @Override
    public int setLayout() {
        return R.layout.activity_team;
    }

    @Override
    public void getExtras() {

    }

    @Override
    public boolean init() {
        initTab();
        initRecycle();
        return false;
    }

    private void initTab() {

        tablayout.addTab(tablayout.newTab().setText("用户"));
        tablayout.addTab(tablayout.newTab().setText("高级合伙人"));
        tablayout.addTab(tablayout.newTab().setText("合伙人"));
        tablayout.setTabIndicatorFullWidth(false);
    }

    @Override
    public void setListener() {
        backListener(titleBar);
    }

    @Override
    public void setupAcitivtyComponent(AppComponent appComponent) {

    }

    private void initRecycle() {
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
        recycleTeam.setLayoutManager(linearLayoutManager);
        teamAdapter = new TeamAdapter();
        recycleTeam.setAdapter(teamAdapter);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            /*case R.id.button_sure:
                Intent intent = new Intent(UIUtil.getContext(), RechargeActivity.class);
                intent.putExtra(Constant.from, Constant.from);
                startActivity(intent);
                break;
            case R.id.tv_withdrawal:
                startActivity(new Intent(UIUtil.getContext(), WithDrawalActivity.class));
                break;*/
        }
    }
}
